Skip to content

return unfixed len if pat has reported error#117046

Merged
bors merged 1 commit into
rust-lang:masterfrom
bvanjoi:fix-116186
Oct 24, 2023
Merged

return unfixed len if pat has reported error#117046
bors merged 1 commit into
rust-lang:masterfrom
bvanjoi:fix-116186

Conversation

@bvanjoi
Copy link
Copy Markdown
Contributor

@bvanjoi bvanjoi commented Oct 22, 2023

This issue arises due to the creation of a fixed-length pattern, as a result of the mir body corruption. The corruption taints tcx.eval_to_allocation_raw, causing it to return AlreadyReported. Consequently, this prevents len.try_eval_target_usize from evaluating correctly and returns None. Lastly, it results in the return of [usize; min_len].

To rectify this issue, my approach is that to return unfixed when encountering ErrorHandled::Reported. Additionally, in instances of ErrorHandled::TooGeneric, the previous logic has been reinstated.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE: expected usize, got UnevaluatedConst ICE: expected usize, got Const

5 participants